package ginHelper

var Groups = make(map[string]*Group)

type Group struct {
	Path        string
	Handlers    map[string]Handler
	Description string
}

func (g *Group) RegisterHandler(h Handler) {
	g.Handlers[h.Name()] = h
}

func NewGroup(path string, description string) *Group {
	return &Group{
		Path:        path,
		Description: description,
		Handlers:    make(map[string]Handler),
	}
}

func NewGroupAndRegister(path string, description string) *Group {
	group := NewGroup(path, description)
	RegisterGroup(group)
	return group
}
